/** layuiAdmin.std-v1.2.1 LPPL License By http://www.layui.com/admin/ */
;layui.define(["table", "form"], function(t) {
    var e = layui.$,
    	$ = layui.jquery,
        i = layui.table,
        n = layui.form;
    i.render({
        elem: "#LAY-app-content-list",
        url: "list_data.xhtml",
        cols: [[{
            type: "checkbox",
            fixed: "left"
        }, {
            field: "uuid",
            hide:true,
            title: "UIID"
        }, {
        	title: "位置",
        	templet:"<div>{{d.deviceCabinetBox.deviceGateway.deviceController.controller_name}}--{{d.deviceCabinetBox.deviceGateway.gateway_name}}--{{d.deviceCabinetBox.cabinetbox_name}}</div>"
        }, {
            field: "goods_name",
            title: "商品名称",
            minWidth: 100
        }, {
        	field: "price",
        	title: "价格（元/kg）",
        	minWidth: 50
        }, {
        	field: "weight",
        	title: "重量（kg）",
        	minWidth: 50
        }, {
            title: "操作",
            minWidth: 150,
            type: 'toolbar',
            align: "center",
            toolbar: "#table-content-list"
        }]],
        page: !0,
        limit: 10,
        limits: [10, 15, 20, 25, 30],
        text: {
        	none:"暂无数据！"
        }
    }),
    i.on("tool(LAY-app-content-list)", function(t) {
        var e = t.data;
        var layEvent = t.event;
        switch(layEvent){
        case "del":
        	layer.confirm("确定删除此网关信息？", function(e) {
            	$.post("del.xhtml",{"uuid":t.data.uuid},function(data){
            		i.reload('LAY-app-content-list');
                });
                layer.close(e);
        	})
        	break;
        case "edit":
        	layer.open({
	            type: 2,
	            title: "编辑",
	            content: "edit.xhtml?uuid="+e.uuid,
	            maxmin: !0,
	            area: ["550px", "550px"],
	            btn: ["确定", "取消"],
	            yes: function(e, i) {
	                var l = window["layui-layer-iframe" + e],
	                    a = i.find("iframe").contents().find("#layuiadmin-app-form-submit");
	                a.trigger("click");
	            }
	        })
	        break;
        default:
        	break;
        }
    }),
    t("goods/stockgoods/list", {})
});
